package com.sdp.lease.db.l_supplier.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sdp.lease.db.l_supplier.entity.LSupplier;
import com.sdp.lease.db.l_supplier.mapper.LSupplierMapper;
import com.sdp.lease.db.l_supplier.service.ILSupplierService;
import com.sdp.lease.db.l_supplier_apply.entity.LSupplierApply;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-07-25
 */
@Service
public class LSupplierServiceImpl extends ServiceImpl<LSupplierMapper, LSupplier> implements ILSupplierService {

	@Override
	public int querySupplierIsExist(LSupplierApply apply) {
		LambdaQueryWrapper<LSupplier> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(LSupplier::getSupplierAccountNo, apply.getSupplierAccountNo())
			.or().eq(LSupplier::getSupplierUscc, apply.getSupplierUscc());
		return count(queryWrapper);
	}

}
